<?php namespace Common\Model;
use Hdphp\Model\Model;
//管理员模型
class Admin extends Model{
	//指明表名
	protected $table = "admin";
	//自动验证
	protected $validate = array(
		array('new_password','minlen:6','新密码长度不得小于6位',3,2),
		array('new_password','confirm:confirmPassword','两次密码不一致',3,2),
	);
	
	public function store(){
		if(!$this->create()) return false;
		$this->add();
		return true;
	}
	
	public function edit(){
		if(!$this->create()) return false;
		$this->where("admin_id=" . Q('get.admin_id',0,'intval'))->save();
		return true;
	}
	
}

 ?>